import { ref } from 'vue'
import { defineStore } from 'pinia'
import { User } from '../../types/User'
export const useUserStore = defineStore('user', () => {
    // 用戶信息
    const user = ref<User>()
    //设置用户信息
    const setUser = (u: User) => {
        user.value = u
    }
    //清空用户数据
    const delUser = () => {
        user.value = undefined
    }
    return { user, setUser, delUser }
},
    { persist: true })
